Optimal. Leaf size=153 \[ -\frac {3 A-i B}{16 a^3 c f (-\tan (e+f x)+i)}+\frac {A-i B}{16 a^3 c f (\tan (e+f x)+i)}+\frac {A+i B}{12 a^3 c f (-\tan (e+f x)+i)^3}+\frac {x (2 A-i B)}{8 a^3 c}-\frac {i A}{8 a^3 c f (-\tan (e+f x)+i)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 153, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3588, 77, 203} \[ -\frac {3 A-i B}{16 a^3 c f (-\tan (e+f x)+i)}+\frac {A-i B}{16 a^3 c f (\tan (e+f x)+i)}+\frac {A+i B}{12 a^3 c f (-\tan (e+f x)+i)^3}+\frac {x (2 A-i B)}{8 a^3 c}-\frac {i A}{8 a^3 c f (-\tan (e+f x)+i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rule 203
Rule 3588
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {A+B x}{(a+i a x)^4 (c-i c x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (\frac {A+i B}{4 a^4 c^2 (-i+x)^4}+\frac {i A}{4 a^4 c^2 (-i+x)^3}+\frac {-3 A+i B}{16 a^4 c^2 (-i+x)^2}+\frac {-A+i B}{16 a^4 c^2 (i+x)^2}+\frac {2 A-i B}{8 a^4 c^2 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {A+i B}{12 a^3 c f (i-\tan (e+f x))^3}-\frac {i A}{8 a^3 c f (i-\tan (e+f x))^2}-\frac {3 A-i B}{16 a^3 c f (i-\tan (e+f x))}+\frac {A-i B}{16 a^3 c f (i+\tan (e+f x))}+\frac {(2 A-i B) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 a^3 c f}\\ &=\frac {(2 A-i B) x}{8 a^3 c}+\frac {A+i B}{12 a^3 c f (i-\tan (e+f x))^3}-\frac {i A}{8 a^3 c f (i-\tan (e+f x))^2}-\frac {3 A-i B}{16 a^3 c f (i-\tan (e+f x))}+\frac {A-i B}{16 a^3 c f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.39, size = 164, normalized size = 1.07 \[ -\frac {\sec ^2(e+f x) (3 (A (8 f x+2 i)+B (-1-4 i f x)) \cos (2 (e+f x))+(-4 B-2 i A) \cos (4 (e+f x))+24 i A f x \sin (2 (e+f x))+6 A \sin (2 (e+f x))+4 A \sin (4 (e+f x))+18 i A+3 i B \sin (2 (e+f x))+12 B f x \sin (2 (e+f x))-2 i B \sin (4 (e+f x)))}{96 a^3 c f (\tan (e+f x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.54, size = 93, normalized size = 0.61 \[ \frac {{\left (12 \, {\left (2 \, A - i \, B\right )} f x e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-3 i \, A - 3 \, B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 18 i \, A e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (6 i \, A - 3 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, A - B\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{96 \, a^{3} c f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 2.17, size = 192, normalized size = 1.25 \[ -\frac {\frac {6 \, {\left (-2 i \, A - B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{3} c} + \frac {6 \, {\left (2 i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{3} c} + \frac {6 \, {\left (2 i \, A \tan \left (f x + e\right ) + B \tan \left (f x + e\right ) - 3 \, A + 2 i \, B\right )}}{a^{3} c {\left (\tan \left (f x + e\right ) + i\right )}} + \frac {-22 i \, A \tan \left (f x + e\right )^{3} - 11 \, B \tan \left (f x + e\right )^{3} - 84 \, A \tan \left (f x + e\right )^{2} + 39 i \, B \tan \left (f x + e\right )^{2} + 114 i \, A \tan \left (f x + e\right ) + 45 \, B \tan \left (f x + e\right ) + 60 \, A - 9 i \, B}{a^{3} c {\left (\tan \left (f x + e\right ) - i\right )}^{3}}}{96 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.46, size = 257, normalized size = 1.68 \[ \frac {A}{16 f \,a^{3} c \left (\tan \left (f x +e \right )+i\right )}-\frac {i B}{16 f \,a^{3} c \left (\tan \left (f x +e \right )+i\right )}+\frac {\ln \left (\tan \left (f x +e \right )+i\right ) B}{16 f \,a^{3} c}+\frac {i \ln \left (\tan \left (f x +e \right )+i\right ) A}{8 f \,a^{3} c}-\frac {i A}{8 f \,a^{3} c \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {3 A}{16 f \,a^{3} c \left (\tan \left (f x +e \right )-i\right )}-\frac {i B}{16 f \,a^{3} c \left (\tan \left (f x +e \right )-i\right )}-\frac {A}{12 f \,a^{3} c \left (\tan \left (f x +e \right )-i\right )^{3}}-\frac {i B}{12 f \,a^{3} c \left (\tan \left (f x +e \right )-i\right )^{3}}-\frac {\ln \left (\tan \left (f x +e \right )-i\right ) B}{16 f \,a^{3} c}-\frac {i \ln \left (\tan \left (f x +e \right )-i\right ) A}{8 f \,a^{3} c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.06, size = 161, normalized size = 1.05 \[ \frac {\frac {A}{3\,a^3\,c}+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {A}{2\,a^3\,c}-\frac {B\,1{}\mathrm {i}}{4\,a^3\,c}\right )+{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {B}{8\,a^3\,c}+\frac {A\,1{}\mathrm {i}}{4\,a^3\,c}\right )-\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {B}{24\,a^3\,c}+\frac {A\,1{}\mathrm {i}}{12\,a^3\,c}\right )+\frac {B\,1{}\mathrm {i}}{12\,a^3\,c}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4\,1{}\mathrm {i}+2\,{\mathrm {tan}\left (e+f\,x\right )}^3+2\,\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}-\frac {x\,\left (B+A\,2{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,a^3\,c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.79, size = 342, normalized size = 2.24 \[ \begin {cases} \frac {\left (294912 i A a^{9} c^{3} f^{3} e^{10 i e} e^{- 2 i f x} + \left (16384 i A a^{9} c^{3} f^{3} e^{6 i e} - 16384 B a^{9} c^{3} f^{3} e^{6 i e}\right ) e^{- 6 i f x} + \left (98304 i A a^{9} c^{3} f^{3} e^{8 i e} - 49152 B a^{9} c^{3} f^{3} e^{8 i e}\right ) e^{- 4 i f x} + \left (- 49152 i A a^{9} c^{3} f^{3} e^{14 i e} - 49152 B a^{9} c^{3} f^{3} e^{14 i e}\right ) e^{2 i f x}\right ) e^{- 12 i e}}{1572864 a^{12} c^{4} f^{4}} & \text {for}\: 1572864 a^{12} c^{4} f^{4} e^{12 i e} \neq 0 \\x \left (- \frac {2 A - i B}{8 a^{3} c} + \frac {\left (A e^{8 i e} + 4 A e^{6 i e} + 6 A e^{4 i e} + 4 A e^{2 i e} + A - i B e^{8 i e} - 2 i B e^{6 i e} + 2 i B e^{2 i e} + i B\right ) e^{- 6 i e}}{16 a^{3} c}\right ) & \text {otherwise} \end {cases} - \frac {x \left (- 2 A + i B\right )}{8 a^{3} c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________